$(function(){

    // swiper轮播图

    var mySwiper = new Swiper('#case1', {
        autoplay: 5000, //可选选项，自动滑动
        initialSlide: 0, //默认显示第二张图片索引从0开始
        speed: 800, //设置过度时间
        loop: true,
        // grabCursor: true,//鼠标样式根据浏览器不同而定
        autoplay: {
            delay: 3000
        },
        /*  设置每隔3000毫秒切换 */
        pagination: {
            el: '.swiper-pagination',
            clickable: true,
        },
        navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev',
        },
        /*  设置当鼠标移入图片时是否停止轮播*/
        autoplay: {
            disableOnInteraction: false,
        },
    });

    mySwiper.el.onmouseover = function(){ //鼠标放上暂停轮播
        mySwiper.autoplay.stop();
    }
    mySwiper.el.onmouseleave = function(){
        mySwiper.autoplay.start();
    }

    // 左右切换箭头
    $(".swiper-container").hover(function(){
        $(".swiper-button-prev").addClass("arrow-cart");
        $(".swiper-button-next").addClass("arrow-cart");

    },function(){
        $(".swiper-button-prev").removeClass("arrow-cart");
        $(".swiper-button-next").removeClass("arrow-cart");
    })


    // 滚动监听

    $(window).scroll(function(){
        if($(window).scrollTop() >= 60){
            $(".main-tab-ul1").addClass("posi-fixed").removeClass("main-tab-ul1");
        } else{
            $(".posi-fixed").addClass("main-tab-ul1").removeClass("posi-fixed");
        }
    });

})